﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DadayunApi.Model
{
    /// <summary>
    /// 数据对象ID
    /// </summary>
    public class WFDataObject
    {
        /// <summary>
        /// 数据对象ID
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 所属流程模板ID
        /// </summary>
        public string WFTplId { get; set; }
        /// <summary>
        /// 数据对象类型:1-单据 2-文档 3-报表
        /// </summary>
        public EObjectType ObjectType { get; set; }
        /// <summary>
        /// 数据对象模板ID(单据模板ID,文档模板ID,报表模板ID)
        /// </summary>
        public string ObjId { get; set; }
        /// <summary>
        /// (主单据)在创建流程时必须创建
        /// </summary>
        public bool MustBeNew { get; set; }
        /// <summary>
        /// 数据对象木城.数据对象是单据,则是单据模板名称;数据是文档,则是文档模板名称,数据对象是报表,则是报表名贵
        /// </summary>
        public string ObjName { get; set; }
        public NodeRight[] NodeList { get; set; }
    }
    /// <summary>
    /// 数据对象在各节点的权限
    /// </summary>
    public class NodeRight
    {
        /// <summary>
        /// 所属数据对象Id
        /// </summary>
        public string DataObjectId { get; set; }
        /// <summary>
        /// 节点ID
        /// </summary>
        public string NodeId { get; set; }

        public string NodeName { get; set; }
        /// <summary>
        /// 数据对象在NodeId指向的节点的读取权限
        /// </summary>
        public bool R { get; set; }
        /// <summary>
        /// 数据对象在NodeId所指向的节点的编辑权限
        /// </summary>
        public bool U { get; set; }
    }

    public enum EObjectType
    {
        Form=1,Document=2,Report=3
    }
}
